<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表格</title>
</head>

<body>
    <div id="app">
        
      <input type="button" value="打印此页面" @click="printpage()" />
        <div>123</div>
    </div>
    
</body>
<script src="https://unpkg.com/vue@2.6/dist/vue.min.js"></script>
<script>
  
    // 在 #app 标签下渲染一个按钮组件
    new Vue({
        el: '#app',
        data: {
          
        },
        methods: {
            printpage() {
      window.print()
    }

        }
    })
</script>

<style>
    #app {
        height: 100vh;
        background-color: #f7f7f7;
    }

    
</style>

</html>